import api from '../../api/index'
import * as types from '../mutation-types';

//初始化一个变量
const state = {
  //三会一课
  BranchofLessons: [], //统计分析支部列表新加

}

//操作：发送请求
const actions = {
  //请求个人信息
  searchBranchList({
    commit
  }, params) {
    api.get_branch_lessons_select(params).then(res => {
      commit(types.GET_BRANCH_OF_LESSONS, res);
    });
  }
}

//取变量
const getters = {
  BranchofLessons: state => state.BranchofLessons

}

//数据操作
const mutations = {
  [types.GET_BRANCH_OF_LESSONS](state, res) {
    if (res.code === 0) {
      state.BranchofLessons = []
    } else {
      state.BranchofLessons = res.data
    }
  },


}

export default {
  state,
  actions,
  getters,
  mutations,
}
